angular.module('actionlist.controller',[])
  .controller('actionlistCtrl',['$scope','$timeout' ,'$localstorage','$ionicPopup','actionlistService','$state','loginService',function($scope,$timeout,$localstorage,$ionicPopup,actionlistService,$state,loginService){


    $scope.params={};
    $scope.NavJsonData=[];
    $scope.params=actionlistService.getParams();
     $scope.doRefresh = function() {
            var typeid='T50973';//获取首页配置
            actionlistService.get_twoLayerNavInfo(typeid).then(function(data){
                              $scope.NavJsonData=data;
                            },function(error){
                              var alertPopup=$ionicPopup.alert({
                                title:'获取在网导航失败！',
                                template:"异常错误",
                                okText: '确定', // String (默认: 'OK')。OK按钮的文字。
                                okType: 'item-customer-bg-darkred', // String (默认: 'button-positive')。OK按钮的类型。
                              });
                            });
         };
    $scope.$on('$ionicView.enter', function(event, data) {
          console.log("活动页面进来了");
          if($scope.NavJsonData.length<=0){
            $scope.doRefresh();
          }
    });

  }]);
